package com.crm.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

@Mapper
public interface IndexMapper {
    @Select("select user_name from sys_user where user_id=#{userId}")
    String getUserName(Long userId);

    Integer countBusinessNum(String username, LocalDate beginCreateTime, LocalDate endCreateTime);

    Integer countCluesNum(String username, LocalDate beginCreateTime, LocalDate endCreateTime);

    Integer countContractNum(String username, LocalDate beginCreateTime, LocalDate endCreateTime);

    Double sumAmount(String username, LocalDate beginCreateTime, LocalDate endCreateTime);

    Integer todayBusinessNum(LocalDate now, String username);

    Integer todayCluesNum(LocalDate now, String username);

    Integer todayContractNum(LocalDate now, String username);

    Double salesAmount(LocalDate now, String username);

    Integer countTofollowedCluesNum(String username, LocalDate beginCreateTime, LocalDate endCreateTime);

    Integer countTofollowedBusinessNum(String username, LocalDate beginCreateTime, LocalDate endCreateTime);

    Integer countToallocatedCluesNum(String username, LocalDate beginCreateTime, LocalDate endCreateTime);

    Integer countToallocatedBusinessNum(String username, LocalDate beginCreateTime, LocalDate endCreateTime);
}
